/*
 * hydrogenatom1d.c
 *
 *  Created on: Apr 20, 2010
 *      Author: nvep5898
 */

#include "fdm1dutils.h"

main(){
	printf("inside the hydrogenatom1d\n");
	gsl_matrix* H;
	/*
	 * Eigen vector/Value declaration
	 */
	gsl_vector* pot;
	gsl_vector* eig_val;
	gsl_matrix* eig_vect;
	gsl_vector* pd;

	initConstants();
	printConstants();

	printf("forming the potential:\n");
	pot = formPotHydrogen1D();


	printf("Before forming the HMatrix\n");
	H = formHydrogenHMatrix(pot);
	printf("Done forming the HMatrix,printing\n");
//	printHMatrix(H);
	saveMatrix(H,"HmatrixHydr1d.dat");


	eig_val = gsl_vector_alloc(npoints);
	eig_vect = gsl_matrix_alloc(npoints,npoints);

	//get eigen values and eigen vectors of Hmatrix
	printf("Solving for eigen values\n");
	solveEig(H,eig_val,eig_vect);
	printf("MAIN SIZE EVAL >> %d\n",eig_val->size);


	pd = getProbabDensityFromEigVect(eig_vect,0);
	saveVector(pd,"probab-density-test.dat");

	//print eigen values
	//printEig(eig_val,eig_vect);
	makePlotFiles(eig_val,eig_vect,"Hyd-eigvect.dat","Hyd-eigval.dat","Hyd-prob.dat");

	printf("Exiting program!\n");

}

